//
//  XRNavigationController.m
//  TongMiBaby
//
//  Created by 史伟文 on 15/4/3.
//  Copyright (c) 2015年 XuanRuiTechnology. All rights reserved.
//

#import "XRNavigationController.h"

@interface XRNavigationController ()

@end

@implementation XRNavigationController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    self.navigationController.navigationBar.backgroundColor = [UIColor orangeColor];
    self.navigationController.navigationBar.barTintColor = [UIColor orangeColor];
    
    self.titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 120, 44)];
    self.titleLabel.textColor = [UIColor whiteColor];
    self.titleLabel.textAlignment = NSTextAlignmentCenter;
    self.titleLabel.font = [UIFont fontWithName:HEITIMEDIUM size:20];
    self.navigationItem.titleView = self.titleLabel;
    
    XRButton *backButton =[XRButton buttonWithType:UIButtonTypeCustom];
    backButton.frame=CGRectMake(0, 0, 36, 32);
    [backButton setImage:[UIImage imageNamed:@"icon_navi_返回"] forState:UIControlStateNormal];
    [backButton addTarget:^(XRButton *sender) {
        [self.navigationController popViewControllerAnimated:YES];
    }];
    self.navigationItem.leftBarButtonItem =[[UIBarButtonItem alloc]initWithCustomView:backButton];
    
    self.funcButton =[XRButton buttonWithType:UIButtonTypeCustom];
    self.funcButton.frame=CGRectMake(0, 0, 48, 32);
    [self.funcButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    self.funcButton.titleLabel.font = [UIFont fontWithName:HEITILIGHT size:16];
    self.funcButton.titleLabel.textAlignment = NSTextAlignmentRight;
    self.navigationItem.rightBarButtonItem =[[UIBarButtonItem alloc]initWithCustomView:self.funcButton];
}

@end
